package business;

import models.cms_channel;
import play.Play;

import java.util.List;

public class Constants {
    public static String domain = Play.configuration.getProperty("domain");
    // 超级管理员id
    public static long[] superManagerId = new long[]{1};
    //权限忽略的路径
    public static String[] Path_HuLue={"/FileController/images?uuid"};
    /**----------------------------------*/
    public static String viewAdd ="v=viewAdd";
    public static String viewAddKey ="viewAdd";
    public static String viewUpdate ="v=viewUpdate";
    public static String viewUpdateKey ="viewUpdate";
    public static String postAdd = "v=postAdd";
    public static String postAddKey ="postAdd";
    public static String postUpdate = "v=postUpdate";
    public static String postUpdateKey = "postUpdate";
    public static String postDelete="v=postDelete";
    public static String postDeleteKey="postDelete";
    /**----------------------------------*/

    public static final String KEY_CURR_PAGE = "currPage";
    public static final String KEY_PAGE_SIZE = "pageSize";
    public static final int TEN = 10;
    public static final int ONE = 1;

	public static final int ALREADY_RUN = -11; // 某个操作已执行
    /**
     * 分页主题
     */
    public static final int PAGE_SIMPLE = 1;
    public static final int PAGE_ASYNCH = 2;

    /**
     * 默认风格
     */
    public static final int PAGE_STYLE_DEFAULT = 1;
    public static final int PAGE_SIZE = 10;
    public static String USERFIX="TQTH_USERFIX";
    /**
     * mysql 备份
     */
    public static String sqlbackup_path_and_fix = Play.configuration.getProperty("sqlbackup_path_and_fix");
    public static String sqlbackup_user = Play.configuration.getProperty("sqlbackup_user");
    public static String sqlbackup_password = Play.configuration.getProperty("sqlbackup_password");
    public static String sqlbackup_host = Play.configuration.getProperty("sqlbackup_host");
    public static String sqlbackup_port = Play.configuration.getProperty("sqlbackup_port");
    public static String sqlbackup_database = Play.configuration.getProperty("sqlbackup_database");
    public static String sqlbackup_mysqldump_path = Play.configuration.getProperty("sqlbackup_mysqldump_path");
    public static String abspath = Play.configuration.getProperty("abspath");
    public static String is_server = Play.configuration.getProperty("is_server");
    public static String getAbsPath(){
        String abpath = Play.applicationPath.getAbsolutePath();
//        if(!"true".equals(Constants.is_server)){
//            abpath = abpath.substring(0,abpath.length()-1);
//        }
        return abpath;
    }
    public static String getAbsPath(String filename){
        String abpath2 = Play.applicationPath.getAbsolutePath();
//        if(!"true".equals(Constants.is_server)){
//            abpath2 = abpath2.substring(0,abpath2.length()-1);
//        }
        return abpath2 + abspath + filename;
    }
}
